package com.rc.saas.tenant.vo.parking;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author wangzhengwei
 * @create 2021/9/10
 */
public class ElecParkingOrderExportVo {

    @ExcelProperty("订单号")
    private String orderNum;

    @ExcelProperty("桩群名")
    private String stationName;

    @ExcelProperty("桩群编号")
    private String stationNo;

    @ExcelProperty("订单状态")
    private String status;

    @ExcelIgnore
    private String outOrderStatus;

    @ExcelIgnore
    private String orderType;

    @ExcelIgnore
    private String selfOrderStatus;

    @ExcelProperty("临时停车状态")
    private String tempParkStatus;

    @ExcelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date orderStartTime;

    @ExcelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date orderEndTime;

    @ExcelProperty("入场时间")
    private String entryTime;

    @ExcelProperty("出场时间")
    private String outTime;

    @ExcelProperty("车牌号")
    private String carNumber;

    @ExcelProperty("充电时长")
    private Integer chargeDuration;

    @ExcelProperty("停车订单号")
    private String outTradeNum;

    @ExcelProperty("优惠券单号")
    private String outTicketNum;

    @ExcelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    public String getSelfOrderStatus() {
        return selfOrderStatus;
    }

    public void setSelfOrderStatus(String selfOrderStatus) {
        this.selfOrderStatus = selfOrderStatus;
    }

    public String getOutOrderStatus() {
        return outOrderStatus;
    }

    public void setOutOrderStatus(String outOrderStatus) {
        this.outOrderStatus = outOrderStatus;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getStationNo() {
        return stationNo;
    }

    public void setStationNo(String stationNo) {
        this.stationNo = stationNo;
    }

    public String getStatus() {
        if ("0".equals(orderType)) {
            if ("0".equals(outOrderStatus)){
                return "未处理";
            }else if("1".equals(outOrderStatus)){
                return "已处理";
            }else if ("2".equals(outOrderStatus)){
                return "额外优惠";
            }

        } else if ("1".equals(orderType)) {
            if ("0".equals(selfOrderStatus)){
                return "进场未支付";
            }else if("1".equals(selfOrderStatus)){
                return "出场未支付";
            }else if("2".equals(selfOrderStatus)){
                return "出场已支付";
            }else if("3".equals(selfOrderStatus)){
                return "已出场";
            }
        }else {
            return "未知";
        }
        return "";
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTempParkStatus() {
        return tempParkStatus;
    }

    public void setTempParkStatus(String tempParkStatus) {
        if ("4".equals(tempParkStatus)){
            this.tempParkStatus = "出闸";
        }else if ("3".equals(tempParkStatus)){
            this.tempParkStatus = "出闸扫码";
        }else if ("2".equals(tempParkStatus)){
            this.tempParkStatus = "入闸";
        }else if ("1".equals(tempParkStatus)){
            this.tempParkStatus = "入闸扫码";
        }else {
            this.tempParkStatus = "非临时车";
        }
    }

    public Date getOrderStartTime() {
        return orderStartTime;
    }

    public void setOrderStartTime(Date orderStartTime) {
        this.orderStartTime = orderStartTime;
    }

    public Date getOrderEndTime() {
        return orderEndTime;
    }

    public void setOrderEndTime(Date orderEndTime) {
        this.orderEndTime = orderEndTime;
    }

    public String getEntryTime() {
        return entryTime;
    }

    public void setEntryTime(String entryTime) {
        this.entryTime = entryTime;
    }

    public String getOutTime() {
        return outTime;
    }

    public void setOutTime(String outTime) {
        this.outTime = outTime;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public Integer getChargeDuration() {
        return chargeDuration;
    }

    public void setChargeDuration(Integer chargeDuration) {
        this.chargeDuration = chargeDuration;
    }

    public String getOutTradeNum() {
        return outTradeNum;
    }

    public void setOutTradeNum(String outTradeNum) {
        this.outTradeNum = outTradeNum;
    }

    public String getOutTicketNum() {
        return outTicketNum;
    }

    public void setOutTicketNum(String outTicketNum) {
        this.outTicketNum = outTicketNum;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
}
